package com.xinke.juc.case03;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.locks.LockSupport;


/**
 * @Author：xinke
 * @Date：2025/9/30
 * @Desc: 如果打断标记已经是 true, 则 park 会失效
 */
@Slf4j
public class TestInterrupt06 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            for (int i = 0; i < 5; i++) {
                log.debug("park...");
                LockSupport.park();
                log.debug("打断状态：{}", Thread.currentThread().isInterrupted());
            }
        });
        t1.start();
        Thread.sleep(1000);
        t1.interrupt();
    }
}
